package com.ashley.thread.test2;

public class Main {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        for (int i = 0; i < 100; i++) {
            MyThread myThread = new MyThread();
            myThread.start();
        }
        try {
            for (int i = 0; i < 10; i++) {
                System.out.println(Thread.currentThread().getName() + ":" + System.currentTimeMillis());
                int time = (int) (Math.random() * 1000);
                Thread.sleep(time);
            }
        } catch (Exception e) {
            // TODO: handle exception
        }
        long end = System.currentTimeMillis();
        System.out.println(Thread.currentThread().getName() + ":" + (end - start) + "ms");

    }
}
